/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made 
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */
static char SccsId[] = "@(#)acmul.c	1.5	9/19/95";
#include <farl.h>
#include <agl.h>

/*
 * カメラのマトリクスによる変換
 */
void
AGLCameraMulMatrix(fix187 m187[4][4], fix1015 m1015[3][3])
{
     /* カメラの187マトリクスに渡されたマトリクスを掛ける */
     if (__AGLCamera.camChanged == -2) {
	  FarlMatrixCopy4x4((unsigned short*)__AGLCamera.camMatrix187,
	  			(unsigned short*)m187);
     } else {
	  FarlSetSrcMatrix((unsigned short*)__AGLCamera.camMatrix187);
	 FarlMul4x4M187((unsigned short*)m187);
	 FarlCopyDstToMem4x4((unsigned short*)__AGLCamera.camMatrix187);
     }

     /* カメラの1015マトリクスに渡されたマトリクスを掛ける */
     if (__AGLCamera.camChanged < 0) {
	  FarlMatrixCopy3x3((unsigned short*)__AGLCamera.camMatrix1015,
	  			(unsigned short*)m1015);
     } else {
	  FarlSetSrcMatrix3x3((unsigned short*)__AGLCamera.camMatrix1015);
	 FarlMul3x3M1015((unsigned short*)m1015);
	 FarlCopyDstToMem3x3((unsigned short*)__AGLCamera.camMatrix1015);
     }
     __AGLCamera.camChanged = 1;
}
